RandomCircle <- function(x, y, r, n1, n2) {
  number1 = 0
  number2 = 0
  size = 0
  l = list(1:(n1+n2)*0)
  
  while (number1 != n1 || number2 != n2) {
    point = c(runif(1, 0, 1), runif(1, 0, 1))
    cond = (x - point[1])^2 + (y - point[2])^2 - r^2
    #print(cond)
    if (cond >= 0 && number1 < n1) {
      number1 = number1 + 1
      size = size + 1
      l[[size]] = c(point, 1)
      next
    }
    if (cond < 0 && number2 < n2) {
      number2 = number2 + 1
      size = size + 1
      l[[size]] = c(point, -1)
      next
    }
  }
  write(unlist(l), "train2.txt", ncolumn=3)
}

RandomCircle(1, 1, 0.5, 100, 100)

RandomCircle(1, 1, 0.5, 100, 100)
 
